package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizApplyBill;
import com.nmf.dao.gen.bean.BizApplyBillExample.Criteria;
import com.nmf.dao.gen.bean.BizApplyBillExample.Criterion;
import com.nmf.dao.gen.bean.BizApplyBillExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;

public class BizApplyBillSqlProvider {
    /** biz_apply_bill */
    public String countByExample(BizApplyBillExample example) {
        SQL sql = new SQL();
        sql.SELECT("count(*)").FROM("biz_apply_bill");
        applyWhere(sql, example, false);
        return sql.toString();
    }

    /** biz_apply_bill */
    public String deleteByExample(BizApplyBillExample example) {
        SQL sql = new SQL();
        sql.DELETE_FROM("biz_apply_bill");
        applyWhere(sql, example, false);
        return sql.toString();
    }

    /** biz_apply_bill */
    public String insertSelective(BizApplyBill record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("biz_apply_bill");
        
        if (record.getId() != null) {
            sql.VALUES("id", "#{id,jdbcType=VARCHAR}");
        }
        
        if (record.getBillStatus() != null) {
            sql.VALUES("bill_status", "#{billStatus,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyType() != null) {
            sql.VALUES("apply_type", "#{applyType,jdbcType=SMALLINT}");
        }
        
        if (record.getCategoryId() != null) {
            sql.VALUES("category_id", "#{categoryId,jdbcType=VARCHAR}");
        }
        
        if (record.getCategoryName() != null) {
            sql.VALUES("category_name", "#{categoryName,jdbcType=VARCHAR}");
        }
        
        if (record.getApplyBookId() != null) {
            sql.VALUES("apply_book_id", "#{applyBookId,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingShouru() != null) {
            sql.VALUES("zhuying_shouru", "#{zhuyingShouru,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZj() != null) {
            sql.VALUES("zhuying_shouru_zj", "#{zhuyingShouruZj,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZhuanjia() != null) {
            sql.VALUES("zhuying_shouru_zhuanjia", "#{zhuyingShouruZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJinfeiZhichu() != null) {
            sql.VALUES("jinfei_zhichu", "#{jinfeiZhichu,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZj() != null) {
            sql.VALUES("jinfei_zhichu_zj", "#{jinfeiZhichuZj,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZhuanjia() != null) {
            sql.VALUES("jinfei_zhichu_zhuanjia", "#{jinfeiZhichuZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getShiyanRenyuan() != null) {
            sql.VALUES("shiyan_renyuan", "#{shiyanRenyuan,jdbcType=INTEGER}");
        }
        
        if (record.getZhigongNum() != null) {
            sql.VALUES("zhigong_num", "#{zhigongNum,jdbcType=INTEGER}");
        }
        
        if (record.getZhuanjiaShu() != null) {
            sql.VALUES("zhuanjia_shu", "#{zhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getBoshiShu() != null) {
            sql.VALUES("boshi_shu", "#{boshiShu,jdbcType=INTEGER}");
        }
        
        if (record.getWaibuzhuanjiaShu() != null) {
            sql.VALUES("waibuzhuanjia_shu", "#{waibuzhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getYanfaXiangmuNum() != null) {
            sql.VALUES("yanfa_xiangmu_num", "#{yanfaXiangmuNum,jdbcType=INTEGER}");
        }
        
        if (record.getYanjiuNum() != null) {
            sql.VALUES("yanjiu_num", "#{yanjiuNum,jdbcType=INTEGER}");
        }
        
        if (record.getGuojiaYanfaNum() != null) {
            sql.VALUES("guojia_yanfa_num", "#{guojiaYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengYanfaNum() != null) {
            sql.VALUES("sheng_yanfa_num", "#{shengYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getJigouNum() != null) {
            sql.VALUES("jigou_num", "#{jigouNum,jdbcType=INTEGER}");
        }
        
        if (record.getShbeiPrice() != null) {
            sql.VALUES("shbei_price", "#{shbeiPrice,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiPriceZj() != null) {
            sql.VALUES("shbei_price_zj", "#{shbeiPriceZj,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiZhuanjia() != null) {
            sql.VALUES("shbei_zhuanjia", "#{shbeiZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuanliNum() != null) {
            sql.VALUES("zhuanli_num", "#{zhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getYearZhuanliNum() != null) {
            sql.VALUES("year_zhuanli_num", "#{yearZhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengqingZhuanli() != null) {
            sql.VALUES("shengqing_zhuanli", "#{shengqingZhuanli,jdbcType=INTEGER}");
        }
        
        if (record.getBiaozhunShu() != null) {
            sql.VALUES("biaozhun_shu", "#{biaozhunShu,jdbcType=INTEGER}");
        }
        
        if (record.getNewGoodSell() != null) {
            sql.VALUES("new_good_sell", "#{newGoodSell,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGoodSellZj() != null) {
            sql.VALUES("new_good_sell_zj", "#{newGoodSellZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGsellZhuanjia() != null) {
            sql.VALUES("new_gsell_zhuanjia", "#{newGsellZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getNewSellProhibt() != null) {
            sql.VALUES("new_sell_prohibt", "#{newSellProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZj() != null) {
            sql.VALUES("new_sell_prohibt_zj", "#{newSellProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZhuanjia() != null) {
            sql.VALUES("new_sell_prohibt_zhuanjia", "#{newSellProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getAllProhibt() != null) {
            sql.VALUES("all_prohibt", "#{allProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZj() != null) {
            sql.VALUES("all_prohibt_zj", "#{allProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZhuanjia() != null) {
            sql.VALUES("all_prohibt_zhuanjia", "#{allProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJiangxiangShu() != null) {
            sql.VALUES("jiangxiang_shu", "#{jiangxiangShu,jdbcType=INTEGER}");
        }
        
        if (record.getCompName() != null) {
            sql.VALUES("comp_name", "#{compName,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.VALUES("address", "#{address,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingYewu() != null) {
            sql.VALUES("zhuying_yewu", "#{zhuyingYewu,jdbcType=VARCHAR}");
        }
        
        if (record.getCompFaren() != null) {
            sql.VALUES("comp_faren", "#{compFaren,jdbcType=VARCHAR}");
        }
        
        if (record.getZhongxinPerson() != null) {
            sql.VALUES("zhongxin_person", "#{zhongxinPerson,jdbcType=VARCHAR}");
        }
        
        if (record.getLinkMan() != null) {
            sql.VALUES("link_man", "#{linkMan,jdbcType=VARCHAR}");
        }
        
        if (record.getMail() != null) {
            sql.VALUES("mail", "#{mail,jdbcType=VARCHAR}");
        }
        
        if (record.getCompUrl() != null) {
            sql.VALUES("comp_url", "#{compUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getXiashuShu() != null) {
            sql.VALUES("xiashu_shu", "#{xiashuShu,jdbcType=INTEGER}");
        }
        
        if (record.getXiashuDaima() != null) {
            sql.VALUES("xiashu_daima", "#{xiashuDaima,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditId() != null) {
            sql.VALUES("province_audit_id", "#{provinceAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditName() != null) {
            sql.VALUES("province_audit_name", "#{provinceAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditId() != null) {
            sql.VALUES("country_audit_id", "#{countryAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditName() != null) {
            sql.VALUES("country_audit_name", "#{countryAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceId() != null) {
            sql.VALUES("province_id", "#{provinceId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceName() != null) {
            sql.VALUES("province_name", "#{provinceName,jdbcType=VARCHAR}");
        }
        
        if (record.getOptId() != null) {
            sql.VALUES("opt_id", "#{optId,jdbcType=VARCHAR}");
        }
        
        if (record.getOptName() != null) {
            sql.VALUES("opt_name", "#{optName,jdbcType=VARCHAR}");
        }
        
        if (record.getCreateDate() != null) {
            sql.VALUES("create_date", "#{createDate,jdbcType=TIMESTAMP}");
        }
        
        if (record.getUpdateDate() != null) {
            sql.VALUES("update_date", "#{updateDate,jdbcType=TIMESTAMP}");
        }
        
        return sql.toString();
    }

    /** biz_apply_bill */
    public String selectByExample(BizApplyBillExample example) {
        SQL sql = new SQL();
        if (example != null && example.isDistinct()) {
            sql.SELECT_DISTINCT("id");
        } else {
            sql.SELECT("id");
        }
        sql.SELECT("bill_status");
        sql.SELECT("apply_type");
        sql.SELECT("category_id");
        sql.SELECT("category_name");
        sql.SELECT("apply_book_id");
        sql.SELECT("zhuying_shouru");
        sql.SELECT("zhuying_shouru_zj");
        sql.SELECT("zhuying_shouru_zhuanjia");
        sql.SELECT("jinfei_zhichu");
        sql.SELECT("jinfei_zhichu_zj");
        sql.SELECT("jinfei_zhichu_zhuanjia");
        sql.SELECT("shiyan_renyuan");
        sql.SELECT("zhigong_num");
        sql.SELECT("zhuanjia_shu");
        sql.SELECT("boshi_shu");
        sql.SELECT("waibuzhuanjia_shu");
        sql.SELECT("yanfa_xiangmu_num");
        sql.SELECT("yanjiu_num");
        sql.SELECT("guojia_yanfa_num");
        sql.SELECT("sheng_yanfa_num");
        sql.SELECT("jigou_num");
        sql.SELECT("shbei_price");
        sql.SELECT("shbei_price_zj");
        sql.SELECT("shbei_zhuanjia");
        sql.SELECT("zhuanli_num");
        sql.SELECT("year_zhuanli_num");
        sql.SELECT("shengqing_zhuanli");
        sql.SELECT("biaozhun_shu");
        sql.SELECT("new_good_sell");
        sql.SELECT("new_good_sell_zj");
        sql.SELECT("new_gsell_zhuanjia");
        sql.SELECT("new_sell_prohibt");
        sql.SELECT("new_sell_prohibt_zj");
        sql.SELECT("new_sell_prohibt_zhuanjia");
        sql.SELECT("all_prohibt");
        sql.SELECT("all_prohibt_zj");
        sql.SELECT("all_prohibt_zhuanjia");
        sql.SELECT("jiangxiang_shu");
        sql.SELECT("comp_name");
        sql.SELECT("address");
        sql.SELECT("zhuying_yewu");
        sql.SELECT("comp_faren");
        sql.SELECT("zhongxin_person");
        sql.SELECT("link_man");
        sql.SELECT("mail");
        sql.SELECT("comp_url");
        sql.SELECT("xiashu_shu");
        sql.SELECT("xiashu_daima");
        sql.SELECT("province_audit_id");
        sql.SELECT("province_audit_name");
        sql.SELECT("country_audit_id");
        sql.SELECT("country_audit_name");
        sql.SELECT("province_id");
        sql.SELECT("province_name");
        sql.SELECT("opt_id");
        sql.SELECT("opt_name");
        sql.SELECT("create_date");
        sql.SELECT("update_date");
        sql.FROM("biz_apply_bill");
        applyWhere(sql, example, false);
        
        if (example != null && example.getOrderByClause() != null) {
            sql.ORDER_BY(example.getOrderByClause());
        }
        
        return sql.toString();
    }

    /** biz_apply_bill */
    public String updateByExampleSelective(Map<String, Object> parameter) {
        BizApplyBill record = (BizApplyBill) parameter.get("record");
        BizApplyBillExample example = (BizApplyBillExample) parameter.get("example");
        
        SQL sql = new SQL();
        sql.UPDATE("biz_apply_bill");
        
        if (record.getId() != null) {
            sql.SET("id = #{record.id,jdbcType=VARCHAR}");
        }
        
        if (record.getBillStatus() != null) {
            sql.SET("bill_status = #{record.billStatus,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyType() != null) {
            sql.SET("apply_type = #{record.applyType,jdbcType=SMALLINT}");
        }
        
        if (record.getCategoryId() != null) {
            sql.SET("category_id = #{record.categoryId,jdbcType=VARCHAR}");
        }
        
        if (record.getCategoryName() != null) {
            sql.SET("category_name = #{record.categoryName,jdbcType=VARCHAR}");
        }
        
        if (record.getApplyBookId() != null) {
            sql.SET("apply_book_id = #{record.applyBookId,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingShouru() != null) {
            sql.SET("zhuying_shouru = #{record.zhuyingShouru,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZj() != null) {
            sql.SET("zhuying_shouru_zj = #{record.zhuyingShouruZj,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZhuanjia() != null) {
            sql.SET("zhuying_shouru_zhuanjia = #{record.zhuyingShouruZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJinfeiZhichu() != null) {
            sql.SET("jinfei_zhichu = #{record.jinfeiZhichu,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZj() != null) {
            sql.SET("jinfei_zhichu_zj = #{record.jinfeiZhichuZj,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZhuanjia() != null) {
            sql.SET("jinfei_zhichu_zhuanjia = #{record.jinfeiZhichuZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getShiyanRenyuan() != null) {
            sql.SET("shiyan_renyuan = #{record.shiyanRenyuan,jdbcType=INTEGER}");
        }
        
        if (record.getZhigongNum() != null) {
            sql.SET("zhigong_num = #{record.zhigongNum,jdbcType=INTEGER}");
        }
        
        if (record.getZhuanjiaShu() != null) {
            sql.SET("zhuanjia_shu = #{record.zhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getBoshiShu() != null) {
            sql.SET("boshi_shu = #{record.boshiShu,jdbcType=INTEGER}");
        }
        
        if (record.getWaibuzhuanjiaShu() != null) {
            sql.SET("waibuzhuanjia_shu = #{record.waibuzhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getYanfaXiangmuNum() != null) {
            sql.SET("yanfa_xiangmu_num = #{record.yanfaXiangmuNum,jdbcType=INTEGER}");
        }
        
        if (record.getYanjiuNum() != null) {
            sql.SET("yanjiu_num = #{record.yanjiuNum,jdbcType=INTEGER}");
        }
        
        if (record.getGuojiaYanfaNum() != null) {
            sql.SET("guojia_yanfa_num = #{record.guojiaYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengYanfaNum() != null) {
            sql.SET("sheng_yanfa_num = #{record.shengYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getJigouNum() != null) {
            sql.SET("jigou_num = #{record.jigouNum,jdbcType=INTEGER}");
        }
        
        if (record.getShbeiPrice() != null) {
            sql.SET("shbei_price = #{record.shbeiPrice,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiPriceZj() != null) {
            sql.SET("shbei_price_zj = #{record.shbeiPriceZj,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiZhuanjia() != null) {
            sql.SET("shbei_zhuanjia = #{record.shbeiZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuanliNum() != null) {
            sql.SET("zhuanli_num = #{record.zhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getYearZhuanliNum() != null) {
            sql.SET("year_zhuanli_num = #{record.yearZhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengqingZhuanli() != null) {
            sql.SET("shengqing_zhuanli = #{record.shengqingZhuanli,jdbcType=INTEGER}");
        }
        
        if (record.getBiaozhunShu() != null) {
            sql.SET("biaozhun_shu = #{record.biaozhunShu,jdbcType=INTEGER}");
        }
        
        if (record.getNewGoodSell() != null) {
            sql.SET("new_good_sell = #{record.newGoodSell,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGoodSellZj() != null) {
            sql.SET("new_good_sell_zj = #{record.newGoodSellZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGsellZhuanjia() != null) {
            sql.SET("new_gsell_zhuanjia = #{record.newGsellZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getNewSellProhibt() != null) {
            sql.SET("new_sell_prohibt = #{record.newSellProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZj() != null) {
            sql.SET("new_sell_prohibt_zj = #{record.newSellProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZhuanjia() != null) {
            sql.SET("new_sell_prohibt_zhuanjia = #{record.newSellProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getAllProhibt() != null) {
            sql.SET("all_prohibt = #{record.allProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZj() != null) {
            sql.SET("all_prohibt_zj = #{record.allProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZhuanjia() != null) {
            sql.SET("all_prohibt_zhuanjia = #{record.allProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJiangxiangShu() != null) {
            sql.SET("jiangxiang_shu = #{record.jiangxiangShu,jdbcType=INTEGER}");
        }
        
        if (record.getCompName() != null) {
            sql.SET("comp_name = #{record.compName,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.SET("address = #{record.address,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingYewu() != null) {
            sql.SET("zhuying_yewu = #{record.zhuyingYewu,jdbcType=VARCHAR}");
        }
        
        if (record.getCompFaren() != null) {
            sql.SET("comp_faren = #{record.compFaren,jdbcType=VARCHAR}");
        }
        
        if (record.getZhongxinPerson() != null) {
            sql.SET("zhongxin_person = #{record.zhongxinPerson,jdbcType=VARCHAR}");
        }
        
        if (record.getLinkMan() != null) {
            sql.SET("link_man = #{record.linkMan,jdbcType=VARCHAR}");
        }
        
        if (record.getMail() != null) {
            sql.SET("mail = #{record.mail,jdbcType=VARCHAR}");
        }
        
        if (record.getCompUrl() != null) {
            sql.SET("comp_url = #{record.compUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getXiashuShu() != null) {
            sql.SET("xiashu_shu = #{record.xiashuShu,jdbcType=INTEGER}");
        }
        
        if (record.getXiashuDaima() != null) {
            sql.SET("xiashu_daima = #{record.xiashuDaima,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditId() != null) {
            sql.SET("province_audit_id = #{record.provinceAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditName() != null) {
            sql.SET("province_audit_name = #{record.provinceAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditId() != null) {
            sql.SET("country_audit_id = #{record.countryAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditName() != null) {
            sql.SET("country_audit_name = #{record.countryAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceId() != null) {
            sql.SET("province_id = #{record.provinceId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceName() != null) {
            sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}");
        }
        
        if (record.getOptId() != null) {
            sql.SET("opt_id = #{record.optId,jdbcType=VARCHAR}");
        }
        
        if (record.getOptName() != null) {
            sql.SET("opt_name = #{record.optName,jdbcType=VARCHAR}");
        }
        
        if (record.getCreateDate() != null) {
            sql.SET("create_date = #{record.createDate,jdbcType=TIMESTAMP}");
        }
        
        if (record.getUpdateDate() != null) {
            sql.SET("update_date = #{record.updateDate,jdbcType=TIMESTAMP}");
        }
        
        applyWhere(sql, example, true);
        return sql.toString();
    }

    /** biz_apply_bill */
    public String updateByExample(Map<String, Object> parameter) {
        SQL sql = new SQL();
        sql.UPDATE("biz_apply_bill");
        
        sql.SET("id = #{record.id,jdbcType=VARCHAR}");
        sql.SET("bill_status = #{record.billStatus,jdbcType=SMALLINT}");
        sql.SET("apply_type = #{record.applyType,jdbcType=SMALLINT}");
        sql.SET("category_id = #{record.categoryId,jdbcType=VARCHAR}");
        sql.SET("category_name = #{record.categoryName,jdbcType=VARCHAR}");
        sql.SET("apply_book_id = #{record.applyBookId,jdbcType=VARCHAR}");
        sql.SET("zhuying_shouru = #{record.zhuyingShouru,jdbcType=DOUBLE}");
        sql.SET("zhuying_shouru_zj = #{record.zhuyingShouruZj,jdbcType=DOUBLE}");
        sql.SET("zhuying_shouru_zhuanjia = #{record.zhuyingShouruZhuanjia,jdbcType=VARCHAR}");
        sql.SET("jinfei_zhichu = #{record.jinfeiZhichu,jdbcType=DOUBLE}");
        sql.SET("jinfei_zhichu_zj = #{record.jinfeiZhichuZj,jdbcType=DOUBLE}");
        sql.SET("jinfei_zhichu_zhuanjia = #{record.jinfeiZhichuZhuanjia,jdbcType=VARCHAR}");
        sql.SET("shiyan_renyuan = #{record.shiyanRenyuan,jdbcType=INTEGER}");
        sql.SET("zhigong_num = #{record.zhigongNum,jdbcType=INTEGER}");
        sql.SET("zhuanjia_shu = #{record.zhuanjiaShu,jdbcType=INTEGER}");
        sql.SET("boshi_shu = #{record.boshiShu,jdbcType=INTEGER}");
        sql.SET("waibuzhuanjia_shu = #{record.waibuzhuanjiaShu,jdbcType=INTEGER}");
        sql.SET("yanfa_xiangmu_num = #{record.yanfaXiangmuNum,jdbcType=INTEGER}");
        sql.SET("yanjiu_num = #{record.yanjiuNum,jdbcType=INTEGER}");
        sql.SET("guojia_yanfa_num = #{record.guojiaYanfaNum,jdbcType=INTEGER}");
        sql.SET("sheng_yanfa_num = #{record.shengYanfaNum,jdbcType=INTEGER}");
        sql.SET("jigou_num = #{record.jigouNum,jdbcType=INTEGER}");
        sql.SET("shbei_price = #{record.shbeiPrice,jdbcType=DOUBLE}");
        sql.SET("shbei_price_zj = #{record.shbeiPriceZj,jdbcType=DOUBLE}");
        sql.SET("shbei_zhuanjia = #{record.shbeiZhuanjia,jdbcType=VARCHAR}");
        sql.SET("zhuanli_num = #{record.zhuanliNum,jdbcType=INTEGER}");
        sql.SET("year_zhuanli_num = #{record.yearZhuanliNum,jdbcType=INTEGER}");
        sql.SET("shengqing_zhuanli = #{record.shengqingZhuanli,jdbcType=INTEGER}");
        sql.SET("biaozhun_shu = #{record.biaozhunShu,jdbcType=INTEGER}");
        sql.SET("new_good_sell = #{record.newGoodSell,jdbcType=DOUBLE}");
        sql.SET("new_good_sell_zj = #{record.newGoodSellZj,jdbcType=DOUBLE}");
        sql.SET("new_gsell_zhuanjia = #{record.newGsellZhuanjia,jdbcType=VARCHAR}");
        sql.SET("new_sell_prohibt = #{record.newSellProhibt,jdbcType=DOUBLE}");
        sql.SET("new_sell_prohibt_zj = #{record.newSellProhibtZj,jdbcType=DOUBLE}");
        sql.SET("new_sell_prohibt_zhuanjia = #{record.newSellProhibtZhuanjia,jdbcType=VARCHAR}");
        sql.SET("all_prohibt = #{record.allProhibt,jdbcType=DOUBLE}");
        sql.SET("all_prohibt_zj = #{record.allProhibtZj,jdbcType=DOUBLE}");
        sql.SET("all_prohibt_zhuanjia = #{record.allProhibtZhuanjia,jdbcType=VARCHAR}");
        sql.SET("jiangxiang_shu = #{record.jiangxiangShu,jdbcType=INTEGER}");
        sql.SET("comp_name = #{record.compName,jdbcType=VARCHAR}");
        sql.SET("address = #{record.address,jdbcType=VARCHAR}");
        sql.SET("zhuying_yewu = #{record.zhuyingYewu,jdbcType=VARCHAR}");
        sql.SET("comp_faren = #{record.compFaren,jdbcType=VARCHAR}");
        sql.SET("zhongxin_person = #{record.zhongxinPerson,jdbcType=VARCHAR}");
        sql.SET("link_man = #{record.linkMan,jdbcType=VARCHAR}");
        sql.SET("mail = #{record.mail,jdbcType=VARCHAR}");
        sql.SET("comp_url = #{record.compUrl,jdbcType=VARCHAR}");
        sql.SET("xiashu_shu = #{record.xiashuShu,jdbcType=INTEGER}");
        sql.SET("xiashu_daima = #{record.xiashuDaima,jdbcType=VARCHAR}");
        sql.SET("province_audit_id = #{record.provinceAuditId,jdbcType=VARCHAR}");
        sql.SET("province_audit_name = #{record.provinceAuditName,jdbcType=VARCHAR}");
        sql.SET("country_audit_id = #{record.countryAuditId,jdbcType=VARCHAR}");
        sql.SET("country_audit_name = #{record.countryAuditName,jdbcType=VARCHAR}");
        sql.SET("province_id = #{record.provinceId,jdbcType=VARCHAR}");
        sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}");
        sql.SET("opt_id = #{record.optId,jdbcType=VARCHAR}");
        sql.SET("opt_name = #{record.optName,jdbcType=VARCHAR}");
        sql.SET("create_date = #{record.createDate,jdbcType=TIMESTAMP}");
        sql.SET("update_date = #{record.updateDate,jdbcType=TIMESTAMP}");
        
        BizApplyBillExample example = (BizApplyBillExample) parameter.get("example");
        applyWhere(sql, example, true);
        return sql.toString();
    }

    /** biz_apply_bill */
    public String updateByPrimaryKeySelective(BizApplyBill record) {
        SQL sql = new SQL();
        sql.UPDATE("biz_apply_bill");
        
        if (record.getBillStatus() != null) {
            sql.SET("bill_status = #{billStatus,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyType() != null) {
            sql.SET("apply_type = #{applyType,jdbcType=SMALLINT}");
        }
        
        if (record.getCategoryId() != null) {
            sql.SET("category_id = #{categoryId,jdbcType=VARCHAR}");
        }
        
        if (record.getCategoryName() != null) {
            sql.SET("category_name = #{categoryName,jdbcType=VARCHAR}");
        }
        
        if (record.getApplyBookId() != null) {
            sql.SET("apply_book_id = #{applyBookId,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingShouru() != null) {
            sql.SET("zhuying_shouru = #{zhuyingShouru,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZj() != null) {
            sql.SET("zhuying_shouru_zj = #{zhuyingShouruZj,jdbcType=DOUBLE}");
        }
        
        if (record.getZhuyingShouruZhuanjia() != null) {
            sql.SET("zhuying_shouru_zhuanjia = #{zhuyingShouruZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJinfeiZhichu() != null) {
            sql.SET("jinfei_zhichu = #{jinfeiZhichu,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZj() != null) {
            sql.SET("jinfei_zhichu_zj = #{jinfeiZhichuZj,jdbcType=DOUBLE}");
        }
        
        if (record.getJinfeiZhichuZhuanjia() != null) {
            sql.SET("jinfei_zhichu_zhuanjia = #{jinfeiZhichuZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getShiyanRenyuan() != null) {
            sql.SET("shiyan_renyuan = #{shiyanRenyuan,jdbcType=INTEGER}");
        }
        
        if (record.getZhigongNum() != null) {
            sql.SET("zhigong_num = #{zhigongNum,jdbcType=INTEGER}");
        }
        
        if (record.getZhuanjiaShu() != null) {
            sql.SET("zhuanjia_shu = #{zhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getBoshiShu() != null) {
            sql.SET("boshi_shu = #{boshiShu,jdbcType=INTEGER}");
        }
        
        if (record.getWaibuzhuanjiaShu() != null) {
            sql.SET("waibuzhuanjia_shu = #{waibuzhuanjiaShu,jdbcType=INTEGER}");
        }
        
        if (record.getYanfaXiangmuNum() != null) {
            sql.SET("yanfa_xiangmu_num = #{yanfaXiangmuNum,jdbcType=INTEGER}");
        }
        
        if (record.getYanjiuNum() != null) {
            sql.SET("yanjiu_num = #{yanjiuNum,jdbcType=INTEGER}");
        }
        
        if (record.getGuojiaYanfaNum() != null) {
            sql.SET("guojia_yanfa_num = #{guojiaYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengYanfaNum() != null) {
            sql.SET("sheng_yanfa_num = #{shengYanfaNum,jdbcType=INTEGER}");
        }
        
        if (record.getJigouNum() != null) {
            sql.SET("jigou_num = #{jigouNum,jdbcType=INTEGER}");
        }
        
        if (record.getShbeiPrice() != null) {
            sql.SET("shbei_price = #{shbeiPrice,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiPriceZj() != null) {
            sql.SET("shbei_price_zj = #{shbeiPriceZj,jdbcType=DOUBLE}");
        }
        
        if (record.getShbeiZhuanjia() != null) {
            sql.SET("shbei_zhuanjia = #{shbeiZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuanliNum() != null) {
            sql.SET("zhuanli_num = #{zhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getYearZhuanliNum() != null) {
            sql.SET("year_zhuanli_num = #{yearZhuanliNum,jdbcType=INTEGER}");
        }
        
        if (record.getShengqingZhuanli() != null) {
            sql.SET("shengqing_zhuanli = #{shengqingZhuanli,jdbcType=INTEGER}");
        }
        
        if (record.getBiaozhunShu() != null) {
            sql.SET("biaozhun_shu = #{biaozhunShu,jdbcType=INTEGER}");
        }
        
        if (record.getNewGoodSell() != null) {
            sql.SET("new_good_sell = #{newGoodSell,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGoodSellZj() != null) {
            sql.SET("new_good_sell_zj = #{newGoodSellZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewGsellZhuanjia() != null) {
            sql.SET("new_gsell_zhuanjia = #{newGsellZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getNewSellProhibt() != null) {
            sql.SET("new_sell_prohibt = #{newSellProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZj() != null) {
            sql.SET("new_sell_prohibt_zj = #{newSellProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getNewSellProhibtZhuanjia() != null) {
            sql.SET("new_sell_prohibt_zhuanjia = #{newSellProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getAllProhibt() != null) {
            sql.SET("all_prohibt = #{allProhibt,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZj() != null) {
            sql.SET("all_prohibt_zj = #{allProhibtZj,jdbcType=DOUBLE}");
        }
        
        if (record.getAllProhibtZhuanjia() != null) {
            sql.SET("all_prohibt_zhuanjia = #{allProhibtZhuanjia,jdbcType=VARCHAR}");
        }
        
        if (record.getJiangxiangShu() != null) {
            sql.SET("jiangxiang_shu = #{jiangxiangShu,jdbcType=INTEGER}");
        }
        
        if (record.getCompName() != null) {
            sql.SET("comp_name = #{compName,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.SET("address = #{address,jdbcType=VARCHAR}");
        }
        
        if (record.getZhuyingYewu() != null) {
            sql.SET("zhuying_yewu = #{zhuyingYewu,jdbcType=VARCHAR}");
        }
        
        if (record.getCompFaren() != null) {
            sql.SET("comp_faren = #{compFaren,jdbcType=VARCHAR}");
        }
        
        if (record.getZhongxinPerson() != null) {
            sql.SET("zhongxin_person = #{zhongxinPerson,jdbcType=VARCHAR}");
        }
        
        if (record.getLinkMan() != null) {
            sql.SET("link_man = #{linkMan,jdbcType=VARCHAR}");
        }
        
        if (record.getMail() != null) {
            sql.SET("mail = #{mail,jdbcType=VARCHAR}");
        }
        
        if (record.getCompUrl() != null) {
            sql.SET("comp_url = #{compUrl,jdbcType=VARCHAR}");
        }
        
        if (record.getXiashuShu() != null) {
            sql.SET("xiashu_shu = #{xiashuShu,jdbcType=INTEGER}");
        }
        
        if (record.getXiashuDaima() != null) {
            sql.SET("xiashu_daima = #{xiashuDaima,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditId() != null) {
            sql.SET("province_audit_id = #{provinceAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceAuditName() != null) {
            sql.SET("province_audit_name = #{provinceAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditId() != null) {
            sql.SET("country_audit_id = #{countryAuditId,jdbcType=VARCHAR}");
        }
        
        if (record.getCountryAuditName() != null) {
            sql.SET("country_audit_name = #{countryAuditName,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceId() != null) {
            sql.SET("province_id = #{provinceId,jdbcType=VARCHAR}");
        }
        
        if (record.getProvinceName() != null) {
            sql.SET("province_name = #{provinceName,jdbcType=VARCHAR}");
        }
        
        if (record.getOptId() != null) {
            sql.SET("opt_id = #{optId,jdbcType=VARCHAR}");
        }
        
        if (record.getOptName() != null) {
            sql.SET("opt_name = #{optName,jdbcType=VARCHAR}");
        }
        
        if (record.getCreateDate() != null) {
            sql.SET("create_date = #{createDate,jdbcType=TIMESTAMP}");
        }
        
        if (record.getUpdateDate() != null) {
            sql.SET("update_date = #{updateDate,jdbcType=TIMESTAMP}");
        }
        
        sql.WHERE("id = #{id,jdbcType=VARCHAR}");
        
        return sql.toString();
    }

    /** biz_apply_bill */
    protected void applyWhere(SQL sql, BizApplyBillExample example, boolean includeExamplePhrase) {
        if (example == null) {
            return;
        }
        
        String parmPhrase1;
        String parmPhrase1_th;
        String parmPhrase2;
        String parmPhrase2_th;
        String parmPhrase3;
        String parmPhrase3_th;
        if (includeExamplePhrase) {
            parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
            parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
            parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
            parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
            parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
            parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
        } else {
            parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
            parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
            parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
            parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
            parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
            parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
        }
        
        StringBuilder sb = new StringBuilder();
        List<Criteria> oredCriteria = example.getOredCriteria();
        boolean firstCriteria = true;
        for (int i = 0; i < oredCriteria.size(); i++) {
            Criteria criteria = oredCriteria.get(i);
            if (criteria.isValid()) {
                if (firstCriteria) {
                    firstCriteria = false;
                } else {
                    sb.append(" or ");
                }
                
                sb.append('(');
                List<Criterion> criterions = criteria.getAllCriteria();
                boolean firstCriterion = true;
                for (int j = 0; j < criterions.size(); j++) {
                    Criterion criterion = criterions.get(j);
                    if (firstCriterion) {
                        firstCriterion = false;
                    } else {
                        sb.append(" and ");
                    }
                    
                    if (criterion.isNoValue()) {
                        sb.append(criterion.getCondition());
                    } else if (criterion.isSingleValue()) {
                        if (criterion.getTypeHandler() == null) {
                            sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
                        } else {
                            sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
                        }
                    } else if (criterion.isBetweenValue()) {
                        if (criterion.getTypeHandler() == null) {
                            sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
                        } else {
                            sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
                        }
                    } else if (criterion.isListValue()) {
                        sb.append(criterion.getCondition());
                        sb.append(" (");
                        List<?> listItems = (List<?>) criterion.getValue();
                        boolean comma = false;
                        for (int k = 0; k < listItems.size(); k++) {
                            if (comma) {
                                sb.append(", ");
                            } else {
                                comma = true;
                            }
                            if (criterion.getTypeHandler() == null) {
                                sb.append(String.format(parmPhrase3, i, j, k));
                            } else {
                                sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
                            }
                        }
                        sb.append(')');
                    }
                }
                sb.append(')');
            }
        }
        
        if (sb.length() > 0) {
            sql.WHERE(sb.toString());
        }
    }
}